<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        ul li {
            float: left;
            perspective: 400px;
            list-style: none;
            transform-style: preserve-3d;
            margin: 10px 10px;
            height: 30px;
            width: 150px;
        }

        .box {
            perspective: 1000px;
            position: relative;
            transition: all .5s;
            transform-style: preserve-3d;
            height: 30px;
            width: 150px;
        }

        .front,
        .back {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
        }

        .box:hover {
            transform: rotateX(90deg);
        }

        .front {
            transform: translateZ(15px);
            background-color: purple;
        }

        .back {
            transform: translateY(15px) rotateX(-90deg);
            background-color: pink;
        }
    </style>
</head>

<body>
    <ul>
        <li>
            <div class="box">
                <div class="front">黑马程序员</div>
                <div class="back">pink老师在这里等你</div>
            </div>
        </li>
        <li>
            <div class="box">
                <div class="front">黑马程序员</div>
                <div class="back">pink老师在这里等你</div>
            </div>
        </li>
        <li>
            <div class="box">
                <div class="front">黑马程序员</div>
                <div class="back">pink老师在这里等你</div>
            </div>
        </li>
        <li>
            <div class="box">
                <div class="front">黑马程序员</div>
                <div class="back">pink老师在这里等你</div>
            </div>
        </li>
    </ul>

</body>

</html>